import { Component, OnInit, Input } from '@angular/core';
import { ModalController, AlertController, LoadingController } from "@ionic/angular";
import { AppGlobalService } from 'src/app/shared/service/app-global.service';

declare let $: any;
@Component({
  selector: 'app-new-business-info-modal',
  templateUrl: './new-business-info-modal.component.html',
  styleUrls: ['./new-business-info-modal.component.scss'],
})
export class NewBusinessInfoModalComponent implements OnInit {
  @Input() tagData: any;
  listData: any;
  modelID = 'mybicon-modal-box';
  constructor(
    private appGlobalService: AppGlobalService,
    public modalController: ModalController) { }

  ngOnInit() {
    this.modelID += new Date().getTime();
    this.listData = this.tagData;
    setTimeout(() => {
      $("#" + this.modelID).fadeIn(250);
    }, 250);
  }

  // 传值
  go(e, link) {
    try {
      e.stopPropagation();
      // this.modalController.dismiss({ dismissed: true });
      // const tmpSessionId = localStorage.getItem('sessionId');
      // const pageParams = {
      //   pageId: link.target,
      //   params: link.params,
      //   sessionId: tmpSessionId
      // };
      // this.appGlobalService.goToForward(pageParams);
    } catch (error) {
      console.log('error----->' + JSON.stringify(e));
    }


  }


  close(e) {
    $("#" + this.modelID).fadeOut(250);
    setTimeout(() => {
      this.modalController.dismiss();
    }, 250);
  }

}
